package day11;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author oldliu
 * @since 1.0
 */
public class ThreadPool {
    public static void main(String[] args) {
        ExecutorService es = Executors.newFixedThreadPool(4);
        System.out.println(es.getClass().getName());
        for (int i = 0; i < 10; i++) {
            es.submit(new T1());
        }
    }
}
class  T1 extends  Thread{
    @Override
    public void run() {
        for (int i = 0; i <20; i++) {
            System.out.println(super.getName()+"  "+i);
        }
    }
}